package com.SunSoft.PhoneRemoteControl;

import android.app.AlertDialog.Builder;
import android.content.res.Resources;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Message;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
import android.widget.Toast;

final class fn
  implements View.OnTouchListener
{
  public final boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    ImageView localImageView = (ImageView)paramView;
    switch (paramMotionEvent.getAction())
    {
    default:
      return true;
    case 0:
      if (this.a.ay)
      {
        Toast.makeText(this.a, this.a.getString(2131099700), 0).show();
        return true;
      }
      Show_Search.h(this.a).setStreamVolume(3, Show_Search.i(this.a), 0);
      Show_Search.h(this.a).setSpeakerphoneOn(false);
      if (!(Show_Search.h(this.a).isWiredHeadsetOn()))
        Show_Search.a("Test", "no WiredHeadset");
      paramMotionEvent = localImageView.getDrawable();
      paramMotionEvent.setColorFilter(new ColorMatrixColorFilter(Show_Search.a));
      localImageView.setImageDrawable(paramMotionEvent);
      paramView = this.a.getResources().getResourceName(paramView.getId());
      int i = Integer.parseInt(paramView.substring(paramView.length() - 3));
      Show_Search.a("Test", "Test_but_onclick:" + i);
      Show_Search.a("Test", "is_doing:" + String.valueOf(this.a.M));
      if (!(this.a.M))
        switch (i)
        {
        default:
        case 1:
        case 2:
        case 3:
        case 4:
        }
      while (true)
      {
        return true;
        if (Show_Search.c(this.a) == 0)
        {
          this.a.a();
          this.a.K = false;
          if (Show_Search.c(this.a) <= 0)
            continue;
          this.a.S = 2;
          this.a.p.setImageResource(2130837620);
          this.a.Q = false;
          this.a.aj = 0;
          this.a.R = true;
        }
        if (this.a.k == Show_Search.c(this.a))
          Toast.makeText(this.a, this.a.getString(2131099743), 0).show();
        this.a.K = false;
        this.a.Q = false;
        this.a.S = 2;
        this.a.p.setImageResource(2130837620);
        this.a.aj = 1;
        this.a.R = true;
        continue;
        if (Show_Search.c(this.a) == 0)
          Toast.makeText(this.a, this.a.getString(2131099721), 0).show();
        if (this.a.k == 1)
          Toast.makeText(this.a, this.a.getString(2131099744), 0).show();
        this.a.K = false;
        this.a.Q = false;
        this.a.S = 2;
        this.a.p.setImageResource(2130837620);
        this.a.aj = -1;
        this.a.R = true;
        continue;
        if (Show_Search.c(this.a) == 0)
          Toast.makeText(this.a, this.a.getString(2131099721), 0).show();
        this.a.K = true;
        this.a.Q = false;
        this.a.S = 2;
        this.a.p.setImageResource(2130837620);
        Toast.makeText(this.a, this.a.getString(2131099745), 0).show();
        paramView = new Message();
        paramView.what = 3;
        this.a.aC.sendMessage(paramView);
        continue;
        if (Show_Search.c(this.a) == 0)
          Toast.makeText(this.a, this.a.getString(2131099721), 0).show();
        this.a.Q = false;
        this.a.S = 2;
        this.a.p.setImageResource(2130837620);
        if (this.a.K)
          this.a.a(0);
        paramView = this.a.getString(2131099879);
        new AlertDialog.Builder(this.a).setTitle(this.a.ao).setMessage(paramView).setPositiveButton(this.a.getString(2131099878), new fo(this)).setNegativeButton(this.a.getString(2131099877), new fp(this)).show();
      }
    case 1:
      Show_Search.a("Test", "Test_but_ACTION_UP:");
      paramView = localImageView.getDrawable();
      paramView.setColorFilter(new ColorMatrixColorFilter(Show_Search.b));
      localImageView.setImageDrawable(paramView);
      return true;
    case 2:
    }
    return false;
  }
}